from flask import Flask, render_template, request, redirect, url_for
app = Flask(__name__)


#CALLPERL
@app.route('/index', methods=['GET', 'POST'])
def indexhello():
    return "index"

#CALLPERL
@app.route('/game', methods=['GET', 'POST'])
def game():
    return "game"

#CALLPERL
@app.route('/apple', methods=['GET', 'POST'])
def apple():
    return "apple"


from flask import make_response


@app.route( '/index', methods=['OPTIONS'])
def perlcors_index():
    methods = 'GET, POST, OPTIONS'
    headers = {
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Methods': methods,
        'Access-Control-Allow-Headers': '*',
        'Access-Control-Max-Age': 3600
    }
    return make_response('', 200, headers)


@app.route( '/game', methods=['OPTIONS'])
def perlcors_game():
    methods = 'GET, POST, OPTIONS'
    headers = {
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Methods': methods,
        'Access-Control-Allow-Headers': '*',
        'Access-Control-Max-Age': 3600
    }
    return make_response('', 200, headers)


@app.route( '/apple', methods=['OPTIONS'])
def perlcors_apple():
    methods = 'GET, POST, OPTIONS'
    headers = {
        'Access-Control-Allow-Origin': '*',
        'Access-Control-Allow-Methods': methods,
        'Access-Control-Allow-Headers': '*',
        'Access-Control-Max-Age': 3600
    }
    return make_response('', 200, headers)


